package com.guigu.buy.service.impl;

import com.guigu.buy.mapper.OutGatherMapper;
import com.guigu.buy.pojo.OutDetails;
import com.guigu.buy.mapper.OutDetailsMapper;
import com.guigu.buy.pojo.OutGather;
import com.guigu.buy.service.IOutDetailsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author com.guigu
 * @since 2024-05-15
 */
@Service
public class OutDetailsServiceImpl extends ServiceImpl<OutDetailsMapper, OutDetails> implements IOutDetailsService {
    @Autowired
    private OutGatherMapper outGatherMapper;
    @Override
    public void add(List<OutDetails> list) {
        int id=outGatherMapper.getNew();
        for (OutDetails o:list){
            o.setId(null);
            o.setParentId(id);
            this.save(o);
        }
    }
}
